﻿@model socialNetwork.Models.Post

@{
    ViewBag.Title = "Create";

    ViewBag.currentUserId = WebSecurity.CurrentUserId;
   
}

<h2>Create @ViewBag.currentUserId</h2>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Post</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.UserId)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserId, new { @Value = "5" })
            @Html.ValidationMessageFor(model => model.UserId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostTitle)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PostTitle)
            @Html.ValidationMessageFor(model => model.PostTitle)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostBody)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PostBody)
            @Html.ValidationMessageFor(model => model.PostBody)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CreateDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CreateDate)
            @Html.ValidationMessageFor(model => model.CreateDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ModifyDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ModifyDate)
            @Html.ValidationMessageFor(model => model.ModifyDate)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
